package com.l024.loanthief.utils;

import android.os.Environment;

import java.io.File;

/**
 * @author wu_ming_zhi_bei
 * @date 2021/1/20 9:50
 * @Notes 文件管理
 */
public class FileUtil {
    public static String createImgPath(){
        String path = Environment.getExternalStorageDirectory()+"/auth";
        File dir = new File(path);
        if(!dir.exists()){
            boolean b = dir.mkdirs();
            if(!b){
                Logutils.e("创建目录失败");
                return "";
            }
        }
        String name = System.currentTimeMillis()+".jpg";
        File file = new File(path+File.separator+name);
        return file.getPath();
    }

    public static String createFilePath(){
        String path = Environment.getExternalStorageDirectory()+"/auth";
        File dir = new File(path);
        if(!dir.exists()){
            boolean b = dir.mkdirs();
            if(!b){
                Logutils.e("创建目录失败");
                return "";
            }
        }
        File file = new File(path);
        return file.getPath();
    }
}
